﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ylh.IDAL;
using Ylh.FactoryDAL;
namespace Ylh.BLL
{
  public  class CustMettingBLL
    {
        private string ConStr = string.Empty;

        public CustMettingBLL(string ConStr)
        {
            this.ConStr = ConStr;
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int InsertMettingInfo(Ylh.Model.TbCustMetting model)
        {
            Ylh.IDAL.ICustMetting icm = DataAccess.CreateICustMetting();

            return icm.InsertMettingInfo(ConStr, model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateMettingInfo(Ylh.Model.TbCustMetting model)
        {
            Ylh.IDAL.ICustMetting icm = DataAccess.CreateICustMetting();

            return icm.UpdateMettingInfo(ConStr, model);

        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int CustMettingID)
        {

            Ylh.IDAL.ICustMetting icm = DataAccess.CreateICustMetting();

            return icm.Delete(ConStr, CustMettingID);
        }


        public void Delete(List<string> li)
        {
            foreach (string  str in li)
            {
                Delete(Convert.ToInt32(str));
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Ylh.Model.TbCustMetting GetModel(int CustMettingID)
        {

            Ylh.IDAL.ICustMetting icm = DataAccess.CreateICustMetting();

            return icm.GetModel(ConStr, CustMettingID);
        }


        public DataTable GetMettingInfo(string StaffID, string CustID)
        {
            Ylh.IDAL.ICustMetting icm = DataAccess.CreateICustMetting();

            return icm.GetMettingInfo(ConStr, StaffID, CustID);

        }


        public bool GetCountmetting( string StaffID, string CustID)
        {
            Ylh.IDAL.ICustMetting icm = DataAccess.CreateICustMetting();

            return icm.GetCountmetting(ConStr, StaffID, CustID);
        } 


    }
}
